package cn.ipanel.bigdata.boot.logger

import java.util.Date

/**
 * Author: lzz
 * Date: 2021/11/16 16:15
 */
private[logger] trait Console { self: Logger =>

  private[this] val STR_FORMAT: String = "%1$tF %1$tT.%1$tL [Tid:%2$s] [%3$s] %4$s :: %5$s"
  private[logger] def getName: String
  private[logger] def _log(tag: String, args: String): Unit = {
    println(String.format(STR_FORMAT,
                          new Date,
                          String.valueOf(Thread.currentThread().getId),
                          tag,
                          getName,
                          args))
  }
}